<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .one {
        background-color: green;
      }
    </style>
  </head>
  <body>
    <!-- 1. 定义一个根标签,未来用来插入动态创建的dom对象 -->
    <div id="root"></div>
    <!-- 2. 引入react和react-dom-->
    <script src="./js/react.development.js"></script>
    <script src="./js/react-dom.development.js"></script>
    <script src="./js/babel.min.js"></script>

    <!-- 3. 根据数据,动态的插件虚拟dom -->
    <!-- type="text/babel" 是告诉babel这个里面的代码需要被编译 -->
    <script type="text/babel">
      let obj = { name: 'lt', info: 'lsp' }
      // 注释
      const div = (
        // 注释
        <div id="box" className="one">
          <h3>lt</h3>
          <p>lsp</p>
          <input type="text" />
          {/*这是jsx中国的注释*/}
          // <label for=""></label>
        </div>
      )

      //   4. 让react帮我们将虚拟dom创建成真实dom,并渲染到页面

      ReactDOM.render(div, document.getElementById('root'))
    </script>
  </body>
</html>
